package weixinkeji.dev.dc.base.food.h.food;

import com.alibaba.fastjson.JSON;
import sys.wx.ann.hm.H;
import sys.wx.ann.hm.M;
import sys.wx.c.ATR;
import sys.wx.c.components.check.bean.CheckData;
import sys.wx.c.components.cv.CV;
import sys.wx.m.db.SQL.mysql.common.where.Where;
import sys.wx.m.db.dao.mysql.Dao;
import weixinkeji.dev.dc.base.food.bean.Food;

/**
 *
 * @author IMY
 */
@H("weixinkeji/dev/dc/base/food/s")
public class FoodS {

    @M("/one")//weixinkeji/dev/dc/base/food/s/one.imy
    public static String hi2(ATR a) {
        String code = CV.getParameter(a.request, "food_code", CheckData.TEXT_L + "{1,26}");
        if (null != code) {
            a.printOne(JSON.toJSONString(Dao.selectOneByTJ(Food.class,
                    Where.putThenGet(Where.TJ_IGNORE_NOTHING, null, "", "food_code", "=", code))));
        }
        return null;
    }

}
